package sessionBeans;

import java.util.HashSet;
import java.util.Set;

import javax.ejb.Stateless;
import javax.persistence.NamedQuery;
import javax.persistence.Query;

import entityBeans.Contact;
import entityBeans.Entreprise;
import sessionBeans.Interfaces.IGestEntrepriseRemote;

/**
 * Session Bean implementation class GestEntreprise
 */
@Stateless(mappedName = "GestEntrepriseEntity")
@NamedQuery(name = "findAll", query = "SELECT OBJECT(emp) FROM entreprise emp")
public class GestEntreprise extends GestCrud<Entreprise> implements IGestEntrepriseRemote {

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
     * Default constructor. 
     */
    public GestEntreprise() {
        // TODO Auto-generated constructor stub
    	super(Entreprise.class);
    }
    
    public Set<Entreprise> findAll() {
		// TODO Auto-generated method stub
		Query q = em.createQuery("FROM Entreprise");
		return new HashSet<Entreprise>(q.getResultList());
	}

}
